package cn.com.qingz.modules.user.model;
/**
 *"AddedTime": "2015-05-09",//未使用
 "Categoryid": 67, //分类id
 "Orders": 0,//未使用
 "ParentId": 0, //父id
 "Title": "电器"
 */

import cn.com.qingz.core.model.EasyUITree;
import cn.com.qingz.core.model.FiledComment;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 资源分类
 */
@Table(name = "category")
public class Category {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @FiledComment("ID")
    private Integer categoryid;

    private Integer orders;

    @FiledComment("父ID")
    private String parentId;

    @FiledComment("分类名")
    private String title;

    @FiledComment("新增时间")
    private String addedTime;

    @FiledComment("级别")
    private Integer level;

    public String getAddedTime() {
        return addedTime;
    }

    public void setAddedTime(String addedTime) {
        this.addedTime = addedTime;
    }

    public Integer getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(Integer categoryid) {
        this.categoryid = categoryid;
    }

    public Integer getOrders() {
        return orders;
    }

    public void setOrders(Integer orders) {
        this.orders = orders;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Category() {}

    public Category(Integer categoryid, String parentId, String title) {
        this.categoryid = categoryid;
        this.parentId = parentId;
        this.title = title;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public EasyUITree getNode(){
        EasyUITree node = new EasyUITree();
        node.setId(categoryid.toString());
        node.setText(title);
        return node;
    }
}
